<?php

include("datacon.php");

if(isset($_POST['submit']))

{

   $author=$_POST['author'];
   $email=$_POST['email'];
   $url=$_POST['url'];
   $comment=$_POST['comment'];

if(strlen($author)<1)

   {

      print "You did not enter a name.";

   }

   else if(strlen($comment)<1)

   {

      print "You did not enter a comment.";

   }


 else

   {	

	$comment = str_replace("[1]","<img src='images1/smile.gif'>",$comment);
	$comment = str_replace("[2]","<img src='images1/smile-2.gif'>",$comment);
	$comment = str_replace("[3]","<img src='images1/wacko.gif'>",$comment);
	$comment = str_replace("[4]","<img src='images1/unsure.gif'>",$comment);
	$comment = str_replace("[5]","<img src='images1/toung.gif'>",$comment);
	$comment = str_replace("[6]","<img src='images1/suspicious.gif'>",$comment);
	$comment = str_replace("[7]","<img src='images1/wink.gif'>",$comment);
	$comment = str_replace("[8]","<img src='images1/worried.gif'>",$comment);
	$comment = str_replace("[9]","<img src='images1/weird.gif'>",$comment);
	$comment = str_replace("[10]","<img src='images1/sad.gif'>",$comment);
	$comment = str_replace("[11]","<img src='images1/sick.gif'>",$comment);
	$comment = str_replace("[12]","<img src='images1/sad.gif'>",$comment);
	$comment = str_replace("[13]","<img src='images1/sad-2.gif'>",$comment);
	$comment = str_replace("[14]","<img src='images1/rolleyes.gif'>",$comment);
	$comment = str_replace("[15]","<img src='images1/wink.gif'>",$comment);
	$comment = str_replace("[16]","<img src='images1/push.gif'>",$comment);
	$comment = str_replace("[17]","<img src='images1/oh.gif'>",$comment);
	$comment = str_replace("[18]","<img src='images1/amazed.gif'>",$comment);
	$comment = str_replace("[19]","<img src='images1/nuts.gif'>",$comment);
	$comment = str_replace("[20]","<img src='images1/noworry.gif'>",$comment);
	$comment = str_replace("[21]","<img src='images1/notrust.gif'>",$comment);
	$comment = str_replace("[22]","<img src='images1/mad.gif'>",$comment);
	$comment = str_replace("[23]","<img src='images1/laugh.gif'>",$comment);
	$comment = str_replace("[24]","<img src='images1/huh.gif'>",$comment);
	$comment = str_replace("[25]","<img src='images1/embarrest.gif'>",$comment);
	$comment = str_replace("[26]","<img src='images1/crying.gif'>",$comment);
	$comment = str_replace("[27]","<img src='images1/cool.gif'>",$comment);
	$comment = str_replace("[28]","<img src='images1/confused.gif'>",$comment);
	$comment = str_replace("[29]","<img src='images1/cheesy.gif'>",$comment);
	$comment = str_replace("[30]","<img src='images1/blink.gif'>",$comment);
	$comment = str_replace("[31]","<img src='images1/amazed.gif'>",$comment);
	$comment = str_replace("[32]","<img src='images1/bigsmile.gif'>",$comment);
	$comment = str_replace("[33]","<img src='images1/amuse.gif'>",$comment);
	
	
      $insert="Insert into ieeetsec.visitordata (author,email,url,comment,entry_date) values('$author','$email','$url','$comment',current_date)";

      mysql_query($insert) or die("Could not insert comment");


     }

  }
?>

<?php

include("index.php");

?>
<?php
include("closedatacon.php");
?>

